package cqie.personal.frame.bo;

import java.util.List;

public class GetCharacterBO {
    private Integer id;
    private String characterName;
    private List<String> menuId;
    private Integer createPerson;
    private Boolean characterAbandon;
    private Integer pageNo;
    private Integer pageMax;
    private Integer pageOff;
    private Integer uid;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public GetCharacterBO(){
        pageNo = 1;
        pageMax = 5;
        setPageOff();
    }
    public Integer getPageOff() {
        return pageOff;
    }

    private void setPageOff( ) {
       pageOff = pageMax * (pageNo-1);
    }

    public Boolean getCharacterAbandon() {
        return characterAbandon;
    }

    public void setCharacterAbandon(Boolean characterAbandon) {
        this.characterAbandon = characterAbandon;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCharacterName() {
        return characterName;
    }

    public void setCharacterName(String characterName) {
        if(!characterName.equals("")) {
            if(!characterName.replace(" ", "").equals("")) {
                this.characterName = characterName;
            }
        }
    }

    public List<String> getMenuId() {
        return menuId;
    }

    public void setMenuId(List<String> menuId) {
        this.menuId = menuId;
    }

    public Integer getCreatePerson() {
        return createPerson;
    }

    public void setCreatePerson(Integer createPerson) {
        this.createPerson = createPerson;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        if(pageNo>0) {
            this.pageNo = pageNo;
            setPageOff();
        }
    }

    public Integer getPageMax() {
        return pageMax;
    }

    public void setPageMax(Integer pageMax) {
        if(pageMax>0) {
            this.pageMax = pageMax;
            setPageOff();
        }
    }
}
